package com.maori.languageapp.fragments;

import com.maori.languageapp.R;

import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTabHost;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.SearchView;

public class Maori_Main_Fragment extends Fragment {

	private static final String TAG = null;

	int tabIndex;

	private FragmentTabHost mTabHost;

	public Maori_Main_Fragment(int linkingIndex) {
		tabIndex = linkingIndex;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		mTabHost = new FragmentTabHost(getActivity());

		// View rootView =
		// inflater.inflate(R.layout.maori_fragment_main,container, false);

		// mTabHost =
		// (FragmentTabHost)rootView.findViewById(android.R.id.tabhost);

		mTabHost.setup(getActivity(), getChildFragmentManager(),
				R.layout.maori_fragment_main);

		Bundle arg1 = new Bundle();
		arg1.putInt("Discover", 1);
		mTabHost.addTab(mTabHost.newTabSpec("Discover")
				.setIndicator("Discover"), Maori_Fragment_Discover.class, arg1);

		Bundle arg2 = new Bundle();
		arg2.putInt("Capture", 2);
		mTabHost.addTab(mTabHost.newTabSpec("Capture").setIndicator("Capture"),
				Maori_Fragment_Capture.class, arg2);

		Bundle arg3 = new Bundle();
		arg3.putInt("Curate", 3);
		mTabHost.addTab(mTabHost.newTabSpec("Curate").setIndicator("Curate"),
				Maori_Fragment_Curate.class, arg3);

		if (tabIndex == 8) {
			Log.v(TAG, "*********CALL SYNC**********");
		} else {
			Log.v(TAG, "*********CALL TABS**********");
			mTabHost.setCurrentTab(tabIndex);
		}

		return mTabHost;
	}
}
